
package com.jf.cloud.flow.feign;

import com.jf.cloud.api.flow.feign.FlowFeignClient;
import com.jf.cloud.common.response.ServerResponseEntity;
import com.jf.cloud.flow.service.ProductAnalyseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.Hidden;

/**
 * @author zz
 * @date 2021/07/01
 */
@RestController
@Hidden
public class FlowFeignController implements FlowFeignClient {
    private static final Logger logger = LoggerFactory.getLogger(FlowFeignController.class);
    @Autowired
    private ProductAnalyseService productAnalyseService;


    @Override
    public ServerResponseEntity<Void> deleteSpuDataBySpuId(Long spuId) {
        try {
            productAnalyseService.deleteSpuDataBySpuId(spuId);
        } catch (Exception e) {
            logger.error("删除商品id:{}的统计数据失败", spuId);
        }
        return ServerResponseEntity.success();
    }

}
